package cn.tedu.spring.eg1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 董代恒
 * @version 1.0
 */
public class TestProduct {
    public static void main(String[] args) {
        //这里传入的参数是一个字符串，指定包的路径，不要带上类名
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.eg1");
        System.out.println(context.getBean("product", Product.class));
    }
}
